Skip to content

feat(web): feed de posts vivo no Início — compositor + algoritmo + conexões - #38

Merged
pmarcura merged 2 commits into
mainfrom
feat/feed-de-posts
May 30, 2026
Merged

feat(web): feed de posts vivo no Início — compositor + algoritmo + conexões#38
pmarcura merged 2 commits into
mainfrom
feat/feed-de-posts

Conversation

@pmarcura

Copy link
Copy Markdown
Owner

O que muda (Onda 2)

O Início vira uma rede social cívica viva — fim das 3 superfícies separadas.

  • Compositor de posts (post-compositor.ts): evento seco → post legível (título humano "Prefeitura contratou X por R$ Y", valor legível, capa temática) + conexões clicáveis (empresa→CNPJ, pessoa, órgão, termos com tooltip) + disclaimer de sanção.
  • Algoritmo de feed (getEventosRanqueados): relevância (categoria + valor log + recência) com cotas por categoria + round-robin → feed variado (contratos não afogam sanções/atos/nomeações).
  • Wikipedia (wikipedia.ts): enriquecimento (foto/resumo) via REST PT — cidade/órgãos, nunca pessoas.
  • Início = feed de posts dos 130k civic_events. /eventos → redirect (unifica).

Validação (live, banco real)

  • 30 posts variados; conexões empresa/pessoa/órgão clicáveis; sanção com aviso "não indica culpa".
  • build / lint OK (/ é ƒ dynamic, não quebra sem banco).

Pendências honestas (próximas ondas)

  • Rua/bairro (geo-tagging), vereadores (Câmara/SISCAM), automação por cron — ver memória.

Tipo

  • ✨ Funcionalidade (produto) · 🎨 Interface

pmarcura and others added 2 commits May 30, 2026 15:43
Fundação do feed de POSTS (Onda 2) — ainda não integrado no Início.

- post-compositor.ts: transforma civic_event seco em post legível —
  título humano ("Prefeitura contratou X por R$ Y"), linha fina, valor
  legível, capa temática (gradiente+ícone), disclaimer de sanção, e
  CONEXÕES clicáveis (empresa→/empresa/CNPJ, pessoa→/pessoa/slug,
  órgão→/orgao/slug, termos cívicos com tooltip do glossário)
- wikipedia.ts: enriquecimento via REST PT (foto/resumo/Wikidata) para
  cidade e órgãos — nunca pessoas comuns (doutrina). Cache 7 dias.

Validado sobre dados reais. Próximo: integrar no Início como feed de
posts visual + drill-down, e remover /eventos.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Onda 2 completa — uma rede social cívica num lugar só.

- eventos.ts: getEventosRanqueados — algoritmo de relevância (categoria + valor
  log + recência) com COTAS por categoria (window) e round-robin, pra o feed ser
  variado e "respirar" (contratos não afogam sanções/atos/nomeações)
- PostCard: cada acontecimento como post estilo Instagram — capa temática, título
  humano, valor legível, conexões CLICÁVEIS (empresa→CNPJ, pessoa, órgão, termos
  com tooltip), disclaimer de sanção, fonte + ver documento
- Início (/): agora é o feed de posts lendo civic_events (130k) — substitui o
  feed de átomos. /eventos → redirect pra / (resolve "tudo isso ser 1")

Validado live: 30 posts variados, conexões empresa/pessoa/órgão clicáveis,
sanção com aviso. Build/lint OK (/ é dynamic).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be3a80ce59

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const conexoes: Conexao[] = [];

// Empresa: CNPJ do fornecedor → página da empresa (drill-down financeiro).
const cnpj = e.entidades?.fornecedorDocumento?.replace(/\D/g, "") ?? null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve creditor CNPJs for payment company links

For TCE-SP payment events, the mapper stores the creditor CNPJ in entidades.credorDocumento (packages/collectors/src/mappers/tce-sp.ts:229-233), not fornecedorDocumento. Because cnpj is derived only from fornecedorDocumento, the pagamento branch's company-chip condition never succeeds for normal payment rows, so the new feed drops the /empresa/{cnpj} navigation for payments even when the CNPJ is available. Please read credorDocumento for pagamentos, or support both keys, before building the link.

Useful? React with 👍 / 👎.

@pmarcura
pmarcura merged commit 997c803 into main May 30, 2026
5 checks passed
@pmarcura
pmarcura deleted the feat/feed-de-posts branch May 30, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant